<template>
  <div class="vfor">
      <h1>{{msg}}</h1>
      <ul>
          <li v-for="(item,index) of arr" :key="index">
             {{index}}: {{item}}
         </li>
         
      </ul>
      <h1>{{message}}</h1>
  </div>
</template>

<script>
import axios from 'axios'
export default {
    name: 'Vfor',
    data() {
        return {
            msg: 'v-for指令,循环',
            arr: [1,2,3,4,5,6,5,5],
            message:''
        }
    },
    methods: {
        handler(){
            console.log("get 方法被调用")
            axios.get("http://localhost:8888/kuayu/msg").then(this.handlerSucc)
        },
        handlerSucc(res) {
            res = res.data
            this.message=res
            console.log(res)
        }
    },
    mounted(){
        this.handler()
    }
}
</script>

<style>

</style>
